package com.ruoyi.ybUpload.service.tableCode.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.ybUpload.domain.ZsSellStock;
import com.ruoyi.ybUpload.mapper.ZsSellStockMapper;
import com.ruoyi.ybUpload.service.tableCode.IZsSellStockService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 商品销售Service业务层处理
 *
 * @author ruoyi
 * @date 2024-09-03
 */
@Service
public class ZsSellStockServiceImpl implements IZsSellStockService
{
    @Autowired
    private ZsSellStockMapper zsSellStockMapper;

    /**
     * 查询商品销售
     *
     * @param id 商品销售主键
     * @return 商品销售
     */
    @Override
    public ZsSellStock selectZsSellStockById(Long id)
    {
        return zsSellStockMapper.selectZsSellStockById(id);
    }

    /**
     * 查询商品销售列表
     *
     * @param zsSellStock 商品销售
     * @return 商品销售
     */
    @Override
    public List<ZsSellStock> selectZsSellStockList(ZsSellStock zsSellStock)
    {
        return zsSellStockMapper.selectZsSellStockList(zsSellStock);
    }

    /**
     * 新增商品销售
     *
     * @param zsSellStock 商品销售
     * @return 结果
     */
    @Override
    public int insertZsSellStock(ZsSellStock zsSellStock)
    {
        zsSellStock.setDelFlag(0L);
        zsSellStock.setCreateTime(DateUtils.getNowDate());
        return zsSellStockMapper.insertZsSellStock(zsSellStock);
    }

    /**
     * 修改商品销售
     *
     * @param zsSellStock 商品销售
     * @return 结果
     */
    @Override
    public int updateZsSellStock(ZsSellStock zsSellStock)
    {
        zsSellStock.setUpdateTime(DateUtils.getNowDate());
        return zsSellStockMapper.updateZsSellStock(zsSellStock);
    }

    /**
     * 批量删除商品销售
     *
     * @param ids 需要删除的商品销售主键
     * @return 结果
     */
    @Override
    public int deleteZsSellStockByIds(Long[] ids)
    {
        return zsSellStockMapper.deleteZsSellStockByIds(ids);
    }

    /**
     * 删除商品销售信息
     *
     * @param id 商品销售主键
     * @return 结果
     */
    @Override
    public int deleteZsSellStockById(Long id)
    {
        return zsSellStockMapper.deleteZsSellStockById(id);
    }
}